package com.example.whatrubbish.mapper;

import com.example.whatrubbish.model.LoginRecord;
import com.example.whatrubbish.vo.Criteria;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component("LoginRecordMapper")
public interface LoginRecordMapper {
    /**
     * 查询上次登录记录
     * @param loginAdminId
     * @return
     */
    LoginRecord selectLastLoginRecord(Long loginAdminId);

    /**
     * 查询用户所有登录记录
     * @param criteria
     * @return
     */
    Long selectAllCountByAdminId(Criteria criteria);
    List<LoginRecord> selectAllByAdminId(Criteria criteria);

    int deleteByPrimaryKey(Long loginId);

    int insert(LoginRecord record);

    int insertSelective(LoginRecord record);

    LoginRecord selectByPrimaryKey(Long loginId);

    int updateByPrimaryKeySelective(LoginRecord record);

    int updateByPrimaryKey(LoginRecord record);
}